package p18.p1822;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;

public class HashMapDemo {
    public static void main(String[] args) {
        HashMap<String, HashMap<String, ArrayList<Student>>> czMap = new HashMap<>();
        //所有           //校区           //班级

        //北京
        HashMap<String, ArrayList<Student>> bj = new HashMap<>();

        //北京-基础
        ArrayList<Student> bjJiChu = new ArrayList<>();
        Student s1 = new Student("1", 1);
        Student s2 = new Student("2", 2);
        bjJiChu.add(s1);
        bjJiChu.add(s2);
        //北京-就业
        ArrayList<Student> bjJiuYe = new ArrayList<>();
        Student s3 = new Student("3", 3);
        Student s4 = new Student("4", 4);
        bjJiuYe.add(s3);
        bjJiuYe.add(s4);

        bj.put("jc", bjJiChu);
        bj.put("jy", bjJiuYe);

        //广州
        HashMap<String, ArrayList<Student>> gz = new HashMap<>();
        //西安
        HashMap<String, ArrayList<Student>> xa = new HashMap<>();

        czMap.put("北京校区", bj);

        Set<String> set = czMap.keySet();
        for (String xiaoQu : set //取出校区
                ) {
            System.out.println("校区:" + xiaoQu);

            HashMap<String, ArrayList<Student>> xq = czMap.get(xiaoQu); //校区
            Set<String> set1 = xq.keySet();
            for (String bj1 : set1 //取出班级
                    ) {
                System.out.println("bj1 = " + bj1);
                ArrayList<Student> bj2 = xq.get(bj1);
                for (Student sss : bj2 //取出学生
                        ) {
                    System.out.println("sss = " + sss);
                }
            }
        }
    }
}
